import { IAchievementWin } from "../interfaces/IAchievementWin";
import { AchievementDataProviderParser } from "../data/AchievementDataProviderParser";
import { SAchievementType } from "../../../../../Message/Game/SAchievementType";
import { ObjCreate } from "../../common/ObjCreate";
import { TilePanel } from "../../equipment/TilePanel";
import { AchievementImportantCellRender } from "../item/AchievementImportantCellRender";
//class AchievementImportantWin
    
    export  class AchievementImportantWin /* flash.display.Sprite */ implements IAchievementWin
    {
        constructor()
        {
            
            this.initView();
            return;
        }

        public updateShowingList(arg1: Array<any>): void
        {
            var loc1=new AchievementDataProviderParser().parse(arg1);
            if (arg1 && arg1[0] is SAchievementType) 
            {
                this._list.visible = true;
                this._list.dataProvider = loc1;
            }
            else if (arg1 == null && !(loc1 == null)) 
            {
                this._list.visible = true;
                this._list.dataProvider = loc1;
            }
            this._list.verticalScrollPosition = 0;
            this._list.drawNow();
            return;
        }

        /* internal  */initView(): void
        {
            ObjCreate.createBg(0, 0, 722, 478, this);
            this._list = new TilePanel();
            this._list.x = 20;
            this._list.y = 4;
            this._list.setSize(700, 470);
            this._list.rowHeight = 66;
            this._list.columnWidth = 680;
            this._list.setStyle("cellRenderer", AchievementImportantCellRender);
            this.addChild(this._list);
            return;
        }

        /* internal */ /* var */_list: TilePanel;
    }
